// 淡入淡出效果
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

// 从上方滑入
.slide-top-enter-active,
.slide-top-leave-active {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.slide-top-enter-from,
.slide-top-leave-to {
  opacity: 0;
  transform: translateY(-100px);
}

// 从下方滑入
.slide-bottom-enter-active,
.slide-bottom-leave-active {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.slide-bottom-enter-from,
.slide-bottom-leave-to {
  opacity: 0;
  transform: translateY(100px);
}

// 从左侧滑入
.slide-left-enter-active,
.slide-left-leave-active {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.slide-left-enter-from,
.slide-left-leave-to {
  opacity: 0;
  transform: translateX(-100px);
}

// 从右侧滑入
.slide-right-enter-active,
.slide-right-leave-active {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.slide-right-enter-from,
.slide-right-leave-to {
  opacity: 0;
  transform: translateX(100px);
}

// 缩放效果
.zoom-enter-active,
.zoom-leave-active {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.zoom-enter-from,
.zoom-leave-to {
  opacity: 0;
  transform: scale(0.2);
}

// 内容区动画
.fade-content-enter-active {
  transition: all 0.3s ease-out;
}

.fade-content-leave-active {
  transition: all 0.2s ease-in;
}

.fade-content-enter-from,
.fade-content-leave-to {
  opacity: 0;
  transform: scale(0.9);
}

// 从上方滑入内容
.slide-top-content-enter-active {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-top-content-leave-active {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-top-content-enter-from,
.slide-top-content-leave-to {
  opacity: 0;
  transform: translateY(-30px);
}

// 从下方滑入内容
.slide-bottom-content-enter-active {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-bottom-content-leave-active {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-bottom-content-enter-from,
.slide-bottom-content-leave-to {
  opacity: 0;
  transform: translateY(30px);
}

// 从左侧滑入内容
.slide-left-content-enter-active {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-left-content-leave-active {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-left-content-enter-from,
.slide-left-content-leave-to {
  opacity: 0;
  transform: translateX(-30px);
}

// 从右侧滑入内容
.slide-right-content-enter-active {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-right-content-leave-active {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-right-content-enter-from,
.slide-right-content-leave-to {
  opacity: 0;
  transform: translateX(30px);
}

// 缩放内容
.zoom-content-enter-active {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.zoom-content-leave-active {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.zoom-content-enter-from,
.zoom-content-leave-to {
  opacity: 0;
  transform: scale(0.95);
}

// CRT 开机效果
.turn-on-enter-active {
  position: relative;
  animation: turnOnBrightness 0.4s ease-out forwards;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    transform: scaleY(0.001);
    animation: turnOnScanline 0.5s ease-out forwards;
  }

  &::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      transparent 0%,
      rgba(255, 255, 255, 0.2) 10%,
      transparent 20%
    );
    background-size: 100% 120%;
    animation: scanEffect 8s linear infinite;
  }
}

.turn-on-leave-active {
  position: relative;
  animation: turnOffBrightness 0.3s ease-out forwards;

  &::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: #fff;
    transform: scaleY(1);
    animation: turnOffCollapse 0.1s ease-in forwards;
  }
}

@keyframes turnOnBrightness {
  0% {
    opacity: 0;
    filter: brightness(.1);
  }
  10% {
    opacity: 1;
    filter: brightness(.5);
  }
  20% {
    opacity: 0.8;
    filter: brightness(.3);
  }
  30% {
    opacity: 1;
    filter: brightness(.2);
  }
  100% {
    opacity: 1;
    filter: brightness(1);
  }
}

@keyframes turnOffBrightness {
  0% {
    opacity: 1;
    filter: brightness(1);
  }
  20% {
    opacity: 0.9;
    filter: brightness(1.2);
  }
  40% {
    opacity: 0.7;
    filter: brightness(0.8);
  }
  60% {
    opacity: 0.5;
    filter: brightness(0.4);
  }
  100% {
    opacity: 0;
    filter: brightness(0);
  }
}

@keyframes turnOnScanline {
  0% {
    transform: scaleY(0.001);
    opacity: 1;
  }
  20% {
    transform: scaleY(1);
    opacity: 1;
  }
  25% {
    transform: scaleY(0.8);
    opacity: 1;
  }
  30% {
    transform: scaleY(1);
    opacity: 1;
  }
  100% {
    transform: scaleY(1);
    opacity: 0;
  }
}

@keyframes turnOffCollapse {
  0% {
    transform: scaleY(1) translateY(0);
    opacity: 1;
  }
  60% {
    transform: scaleY(1) translateY(0);
    opacity: 1;
  }
  100% {
    transform: scaleY(1000) translateY(1000%);
    opacity: 0;
  }
}

@keyframes scanEffect {
  0% {
    background-position: 0 -100%;
  }
  100% {
    background-position: 0 200%;
  }
} 